<?php if(isset($cancel)){?>
<script type="text/javascript"><!--
	window.close();
//--></script> 
<?php }?>
<?php if(isset($redirect)){?>
<script type="text/javascript"><!--
	window.opener.location.href='<?php echo $redirect;?>';
	window.close();
//--></script> 
<?php }?>